<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

// 后台路由
Route::group('admin', function () {
    Route::get('login', 'admin/login/login');
    Route::post('login', 'admin/login/loginPost');
    Route::get('logout', 'admin/login/logout');

    // 首页
    Route::get('index', 'admin/index/index');
    Route::get('desktop', 'admin/index/desktop');

    // 管理员管理
    Route::group('admin', function () {
        Route::get('index', 'admin/admin/index');
        Route::post('index', 'admin/admin/lists');
        Route::get('create', 'admin/admin/create');
        Route::post('create', 'admin/admin/createSubmit');
        Route::post('delete/:id', 'admin/admin/delete');
        Route::get('update/:id', 'admin/admin/update');
        Route::post('update/:id', 'admin/admin/updateSubmit');
    });

    // 角色管理
    Route::group('role', function () {
        Route::get('index', 'admin/role/index');
        Route::post('index', 'admin/role/lists');
        Route::get('create', 'admin/role/create');
        Route::post('create', 'admin/role/createSubmit');
        Route::post('delete/:id', 'admin/role/delete');
        Route::get('update/:id', 'admin/role/update');
        Route::post('update/:id', 'admin/role/updateSubmit');
    });

    // 登录日志
    Route::group('loginLog', function () {
        Route::get('index', 'admin/loginLog/index');
        Route::post('index', 'admin/loginLog/lists');
    });

    // 站点管理
    Route::group('site', function () {
        Route::get('index', 'admin/site/index');
        Route::post('save', 'admin/site/save');
    });
});

// 前台路由
Route::group('home', function () {
    Route::get('/index', 'home/index/index');
});

// 前后台重定向
Route::get('/', 'home/index/toIndex');
Route::get('/admin', 'admin/login/toLogin');
// 统一上传路由
Route::any('/upload', 'upload/upload/upload');



